<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Modules';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="module-index">

    <h1><?= Html::encode($this->title) ?></h1>

    <p>
        <?= Html::a('Create Module', ['create'], ['class' => 'btn btn-success']) ?>
    </p>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'module_id',
            'module_parent_id',
            'module_name',
            'module_desc',
            'module_link',
             'order',
             'target',
             'display',

            [
                'class' => 'yii\grid\ActionColumn',
                'header'=>'操作',
                'template' => '{add} {view} {update} {delete}',
                'buttons' => [
                    'add' => function ($url, $model, $key) {
                        return  Html::a('<span class="glyphicon glyphicon-plus  btn btn-warning btn-sm">添加</span>', $url, ['title' => '添加'] ) ;
                    },
                ],
               'headerOptions' => ['width' => '180']
            ],
        ],

    ]); ?>

</div>
